Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
Javascript return true if record is exist [Multiple]

I don't encounter any problem when only single data is in assignedTo however when multiple data is in assignedTo its validation no longer works, it is separated by the pipeline,

example of single data by assignedTo:

123456

for multiple data of assignedTo:

123456|789101

current code

    hasExistingEvent: (assignedTo) => {
        var assignes = assignedTo.replace(/\|/g, ",")
        return  new Promise((resolve, reject) => {
            .....("SELECT exp_fAssignedTo FROM Event WHERE exp_fAssignedTo LIKE '%" + assignes + "%'", 100, function(a){
                return !resolve(a.length ==0)
            })
        })
    },
    validatedUserExistsEvent: async(data) => {
        var {  assignedTo } = data
        var hasExisting = await _data.hasExistingEvent(assignedTo);
        console.log(hasExisting)
        return hasExisting;
    },

the exp_fAssignedTo field is collection of ids , Its a string of ids. Separated by coma

data from database

enter image description here

I don't know how or what logic to do

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!